import { createWebHistory, createRouter } from 'vue-router'

import AddWork from '../views/AddWork.vue'
import SeeWork from '../views/SeeWork.vue'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Work from '../views/Work.vue'
import SubWork from '../views/SubWork.vue'

const routes = [
    { path: '/', component: Home },
    { path: '/login', component: Login },
    {
        path: '/work',
        component: Work,
        children: [
            { path: 'addwork', component: AddWork },
            { path: 'seework', component: SeeWork }
        ],
        redirect: '/work/addwork'
    },
    { path: '/:id', name: 'subwork', component: SubWork, props: true }

]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router